# Contributor: Bart Ribbers <bribbers@disroot.org>

# The group tag is just to easily find this APKBUILD by some scripts for automation
# group=kde-applications
maintainer="team/kde <bribbers@disroot.org>"
pkgname=kmail-account-wizard
pkgver=24.08.2
pkgrel=0
# armhf blocked by extra-cmake-modules
# ppc64le, s390x, riscv64 and armv7 blocked by qt6-qtwebengine -> kmailtransport
# loongarch64 blocked by pimcommon
arch="all !armhf !ppc64le !s390x !riscv64 !armv7 !loongarch64"
url="https://kontact.kde.org/"
pkgdesc="KMail account wizard"
license="GPL-2.0-or-later AND LGPL-2.0-or-later AND GFDL-1.2-only"
makedepends="
	akonadi-dev
	akonadi-mime-dev
	extra-cmake-modules
	gpgme-dev
	kcmutils-dev
	kcodecs-dev
	kconfig-dev
	kcrash-dev
	kdbusaddons-dev
	kdoctools-dev
	kidentitymanagement-dev
	kimap-dev
	kldap-dev
	kmailtransport-dev
	knewstuff-dev
	knotifications-dev
	knotifyconfig-dev
	kservice-dev
	ktexteditor-dev
	kwallet-dev
	libkdepim-dev
	libkleo-dev
	pimcommon-dev
	qt6-qtbase-dev
	samurai
	shared-mime-info
	"
checkdepends="
	dbus
	xvfb-run
	"
subpackages="$pkgname-lang"
_repo_url="https://invent.kde.org/pim/kmail-account-wizard.git"
source="https://download.kde.org/stable/release-service/$pkgver/src/kmail-account-wizard-$pkgver.tar.xz"

build() {
	cmake -B build -G Ninja \
		-DCMAKE_BUILD_TYPE=RelWithDebInfo \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_INSTALL_LIBDIR=lib
	cmake --build build
}

check() {
	dbus-run-session -- xvfb-run ctest --test-dir build --output-on-failure -E "akonadi-(mysql|sqlite)-accountconfigurationtest"
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
1338043af048b6b59d5310e206f2a0dfded0f1eb50f6a02e1c6eb3cd2d5d9e54ace2bf36375fd5f7a13ce9d74314622e612772329af3ef8859ae334eac789cbf  kmail-account-wizard-24.08.2.tar.xz
"
